package com.tong.embeddedvr.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.nio.charset.Charset;

/*注:这里不能用configuration注解代替component注解,因为configuration应该是要和bean注解配合使用*/
@Component
@ConfigurationProperties(prefix = "shell")
public class ShellConfig {

    /** 远程服务器ip **/
    private String ip;
    /**  用户名 **/
    private String username;
    private String password;
    private String charset = Charset.defaultCharset().toString();

    public static  final int TIME_OUT = 1000 * 5 * 60;

    public ShellConfig() {
    }

    public ShellConfig(String ip, String username, String password, String charset) {
        this.ip = ip;
        this.username = username;
        this.password = password;
        this.charset = charset;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getCharset() {
        return charset;
    }

    public void setCharset(String charset) {
        this.charset = charset;
    }

    @Override
    public String toString() {
        return "ShellConfig{" +
                ", ip='" + ip + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", charset='" + charset + '\'' +
                '}';
    }
}
